package com.patterns.demo.factoryMethod.multipleFactory;

import com.patterns.demo.factoryMethod.multipleFactory.factory.SendFactory;
import com.patterns.demo.factoryMethod.multipleFactory.method.Sender;

/**
 * Author: SamGroves
 * <p>
 * Description: 普通工厂模式
 * <p>
 * Date: 2017/11/27
 */
public class Test {

    public static void main(String[] args) {

        // 获取工厂
        SendFactory sendFactory = new SendFactory();

        // 获取工厂中的某一实现类
        Sender sender1 = sendFactory.produceMail();

        Sender sender2 = sendFactory.produceMessege();

        // 调用实现类中方法
        sender1.send();

        sender2.send();
    }
}
